package net.zjitc.securityloginapi.result;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author 罗翼侨
 * @date 2025/3/11 9:56
 */
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
public class R {
    private Integer code;
    private String msg;
    private Object data;
    public static R ok() {
        return R.builder().code(200).msg("成功").data(null).build();
    }
    public static R ok(int code, String msg,Object data) {
        return R.builder().code(code).msg(msg).data(data).build();
    }
    public static R fail(int code, String msg, Object data){
        return R.builder().code(code).msg(msg).data(data).build();
    }
    public static R fail(){
        return R.builder().code(500).msg("失败").data(null).build();
    }
}
